package netty.mqtt.publish;

/**
 * @Author zhangtao
 * @create 2022/1/20 14:36
 */
public class Test {
    public static void main(String[] args) {
        System.out.println(findOilDIndex(1,3));
        System.out.println(findOilDIndex(2,3));
        System.out.println(findOilDIndex(3,3));
        System.out.println(findOilDIndex(4,3));
        System.out.println(findOilDIndex(5,3));
        System.out.println(findOilDIndex(6,3));
    }


    private static int findOilDIndex(int oilIndex, int length) {
        int res = oilIndex / length + (oilIndex % length == 0 ? 0 : 1);
        return res;
    }
}
